//移动终端浏览userAgent信息
export const ua = {
  isMobile: () => !!navigator.userAgent.match(/AppleWebKit.*Mobile.*/) || !!navigator.userAgent.match(/AppleWebKit/), //是否为移动终端
  isIOS: () => !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
  isAndroid: () => navigator.userAgent.indexOf('Android') > -1 || navigator.userAgent.indexOf('Linux') > -1, //android终端
  isWindows: () => navigator.userAgent.indexOf('Windows') > -1, //widows系统
  isWebview: () => Boolean(navigator.userAgent.match(new RegExp(`(${['WebView', '; wv[)]'].join('|')})`, 'ig'))), //是否是webview
  isQQ: () => navigator.userAgent.indexOf("MQQBrowser") > -1, //内核
  isUC: () => navigator.userAgent.indexOf("UCBrowser") > -1, //内核
  isSogou: () => navigator.userAgent.indexOf("Sogou") > -1, //内核
  isBaidu: () => navigator.userAgent.indexOf("baidu") > -1, //内核
  isWeibo: () => navigator.userAgent.indexOf("WeiBo") > -1, //是否微博
  isWechat: () => navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger", //是否是微信
  isAlipay: () => navigator.userAgent.toLowerCase().indexOf("alipayclient") > -1, //是否支付宝
}
